<%= div_for(conversation, :class =>"#{ 'unread ' if conversation.is_unread?(@actor) }") do %>

  <% conversation_link_to = conversation_path(conversation.id,:box => @box,:page => params[:page]) %>

  <div class="content_left">
    
    <div class="avatar">
      <%= link_to image_tag(conversation.originator.logo.url(:small),
        :title => conversation.originator.name,
        :alt => conversation.originator.name),
        conversation_link_to %>
    </div>

    <header>
      <a>
        <% if conversation.messages.length > 1 %>
          <% addMsgCount = " (" + conversation.messages.length.to_s + ")" %>
        <% else %>
          <% addMsgCount = "" %>
        <% end %>
        <%= link_to truncate_name(conversation.originator.name) + addMsgCount, conversation_link_to %>
      </a>
    </header>
  </div>


  <div class="content_right">
    <div class="subject">
      <%= link_to(truncate(conversation.subject, :length => 55), conversation_link_to) %>
    </div>
    <div class="briefing">
      <%= raw(truncate(strip_tags(conversation.original_message.body), :length => 50)) %>
    </div>
    
  <% unless @box.eql?'trash' %>
    <div class="action"> 
      <%= link_to(raw("<i class='fa fa-trash-o'></i> "),
        conversation_path(conversation, :location => @box, :box => @box, :page => params[:page]),
        :alt => t('mailboxer.delete'), 
        :title => t('mailboxer.delete'),
        :confirm => t('mailboxer.delete_confirm', :csubject => conversation.subject),
        :method => :delete,
        :remote => true) %>
      
    </div>
  <% end %>
   
  </div>

<% end %>

